''' <summary>
''' todo: change list to grid view
''' </summary>
''' <remarks></remarks>
Public Class Form1

    Private ReadOnly _AppPath As String = Application.StartupPath
    Private ReadOnly _Core As New Core(_AppPath)

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        With OpenFileDialog1
            .InitialDirectory = txtXmlUri.Text
            If .ShowDialog() = Windows.Forms.DialogResult.OK Then
                txtXmlUri.Text = .FileName
            End If
        End With
    End Sub

    Private Sub btnAddKey_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddKey.Click

        Dim key As String = txtNewKey.Text
        lstKeys.Items.Add(key)

    End Sub

    Private Sub btnRemoveKey_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRemoveKey.Click

        lstKeys.Items.Remove(lstKeys.SelectedItem)

    End Sub

    Private Sub btnClearKeys_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClearKeys.Click

        lstKeys.Items.Clear()

    End Sub

    Private Sub btnCalc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalc.Click

        Dim tool As String = txtServiceTool.Text
        Dim i18n As String = txtLanguage.Text
        Dim xmlFile As String = txtXmlUri.Text
        Dim keys As New List(Of String)

        For Each key As String In lstKeys.Items
            keys.Add(key)
        Next

        txtExpectedResult.Text = _Core.GetInfoList(tool, keys.ToArray(), i18n, xmlFile)

    End Sub

    Private Sub btnCopy_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCopy.Click

        Dim txt As String = txtExpectedResult.Text

        Clipboard.Clear()
        Clipboard.SetText(txt)

    End Sub
End Class
